package com.woniuxy.shiro.controller;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/teacher")
public class TeacherController extends ExceptionCenter{
    private static final Logger logger = LoggerFactory.getLogger(TeacherController.class);

    @RequestMapping("/add")
    public String add(){
        logger.info("添加教师信息");
        return "success";
    }

    //or或者关系
    //@RequiresRoles(value = {"admin","superAdmin"},logical = Logical.OR)
    @RequiresPermissions(value = {"admin:del"})
    @RequestMapping("/del")
    public String del(){
        logger.info("删除教师");
        return "success";
    }
}
